package com.itheima.day9;

import java.io.File;

public class zuoye5 {
    public static void main(String[] args) {
                        //删除多层嵌套的文件夹

    File zy = new File("C:\\Users\\Administrator\\Desktop\\ZY");
    Shanc(zy);
}

    private static void Shanc(File zy) {
        File[] files = zy.listFiles();
        for (File file : files) {
            if (file.isFile()){
                file.delete();
            }else {
                Shanc(file);
            }
        }
        zy.delete();
    }

}